home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 24 / Mac Magazin and MacEasy Magazine CD - Issue 24.iso / Wissenschaft & Technik / Sys Environment (PPC) Dev ƒ / Headers / sysEnv.h < prev    next >
Text File  |  1996-07-15  |  2KB  |  85 lines

  1. //sysEnv.h ©1996 Brian Bergstrand 07/16/96
  2.  
  3. //headers
  4. #include "machineEnvClass.h"
  5.  
  6. //constants - these should really go in their own header file
  7. //but since there are not that many it's ok
  8. const kBaseResID=128;
  9. const kDialogResID=kBaseResID;
  10. const kAlertID=kBaseResID;
  11. const kErrorStringsID=kBaseResID+2000;
  12. const kArrowCursor=1;
  13. const kWatchCursor=2;
  14. const kSleep=20L;//how much time to give to other Apps
  15. const kOn=1;
  16. const kOff=0;
  17.  
  18. const mApple=kBaseResID;//Apple menu
  19. const iAbout=1;
  20.  
  21. const mFile=kBaseResID+1;//File menu
  22. const iGetInfo=1;
  23. const iQuit=3;
  24.  
  25. const iSysVer=9;//dialog static text items
  26. const iUpdateVer=10;
  27. const iMachine=11;
  28. const iMachineID=12;
  29. const iProcessor=13;
  30. const iRealMem=14;
  31. const iLogicalMem=15;
  32.  
  33. #define kMoveToFront  (WindowPtr)-1L//technically not C++ but it won't hurt
  34.  
  35. //classes
  36. class AppGlobals
  37. {
  38.   public:
  39.     AppGlobals () {done = dialogActive = false;}//constructor
  40.     /*The destructor is not declared virtual, because there is to much
  41.       overhead for only having 2 vars. If you subclass from this, and
  42.       your class has it's own destructor, make sure you declare this 
  43.       destructor virtual, or you could run into trouble when your
  44.       objects are destructed. */
  45.     ~AppGlobals () {}//destructor - does nothing
  46.   
  47.     Boolean done;
  48.     Boolean dialogActive;  
  49. };
  50.  
  51. //structs
  52. struct TextHandles
  53. {//handles to the static text items in the main dialog
  54.   Handle sysVerH;
  55.   Handle updateVerH;
  56.   Handle machineH;
  57.   Handle machineIDH;
  58.   Handle processorH;
  59.   Handle realMemH;
  60.   Handle logicalMemH; 
  61. };
  62.  
  63. //function prototypes
  64. void SwitchCursor (int *);
  65. void InitToolBox (void);
  66. void MenuBarInit (void);
  67. void EventLoop (void);
  68. void DoEvent (EventRecord *);
  69. void HandleMouseDown (EventRecord *);
  70. void HandleMenuChoice (long *);
  71. void HandleAppleChoice (short *);
  72. void HandleFileChoice (short *);
  73. void HandleEnvDialog (void);
  74. static pascal void DrawButtonBorder(WindowPtr, short);
  75. void GetSysEnv (TextHandles **);
  76. Str255 * FindMachine (long *, MachineEnv **);
  77. Str255 * FindSystem (long *);
  78. Str255 * FindProcessor (long *);
  79. void SetStaticString (Handle, Str255 *);
  80. void SetStaticString (Handle, char *);
  81. void HandleDialogEvent(EventRecord *);
  82. Boolean EventFilter(EventRecord *, WindowPtr);
  83. static ControlHandle GetCtlHandle(DialogPtr, short);
  84. void HandleError (short, Boolean, Str255);
  85. inline void Quit (void);